
package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.joysuch.wwyt.core.enums.RiskLevels;
import com.joysuch.wwyt.mh.entity.MhMonitoringType;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

@Component
public class ExportMonitorPointTypeUnitConvertor implements FieldValueConvert<MhMonitoringType, String> {

    @Override
    public String convert(Object bean, MhMonitoringType value, DataDumpField dataField) {
        if(value == null) {
            return null;
        }
        if(StringUtils.isNotBlank(value.getUnit())) {
            return value.getName()+"("+value.getUnit()+")";
        }
        return value.getName();
    }

}
